package com.tao.admin.controller;

import com.tao.admin.service.UserService;
import com.tao.param.CartListParam;
import com.tao.param.PageParam;
import com.tao.pojo.User;
import com.tao.utils.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 86130
 * 用户模块调用
 */
@RestController
@RequestMapping("user")
public class UserController {

    @Resource
    private UserService userService;

    @GetMapping("list")
    public R userList(PageParam pageParam) {
        return userService.userList(pageParam);
    }

    @PostMapping("remove")
    public R userRemove(CartListParam cartListParam) {
        return userService.userRemove(cartListParam);
    }

    @PostMapping("update")
    public R userUpdate(User user) {
        return userService.userUpdate(user);
    }

    @PostMapping("save")
    public R userSave(User user) {
        return userService.userSave(user);
    }
}
